//
//  BandCardListTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/18.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "BandCardListTableViewCell.h"

@implementation BandCardListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.titleLabel];
    [self.bgView addSubview:self.nameLabel];
    [self.bgView addSubview:self.numLabel];
    [self.bgView addSubview:self.btn];
}

-(void)send
{
    self.bgView.backgroundColor = SFMRandColor;
    self.titleLabel.text = @"中国农业银行";
    self.nameLabel.text = @"储蓄卡";
    self.numLabel.text = @"**** **** **** 6779";
}

-(UIView *)bgView
{
    if (_bgView == nil) {
        _bgView = [[UIView alloc] initWithFrame:CGRectMake(15, 11, WIDTH - 30, 155)];
        _bgView.layer.cornerRadius = 10;
        _bgView.clipsToBounds = YES;
    }
    return _bgView;
}

-(UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 30, WIDTH - 120, 30)];
        _titleLabel.font = font(27);
        _titleLabel.textColor = SFMWhiteColor;
        _titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

-(UILabel *)nameLabel
{
    if (_nameLabel == nil) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 75, 120, 20)];
        _nameLabel.font = font(14);
        _nameLabel.textColor = SFMWhiteColor;
        _nameLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _nameLabel;
}

-(UILabel *)numLabel
{
    if (_numLabel == nil) {
        _numLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 110, WIDTH - 120, 20)];
        _numLabel.font = font(24);
        _numLabel.textColor = SFMWhiteColor;
        _numLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _numLabel;
}

-(UIButton *)btn
{
    if (_btn == nil) {
        _btn = [[UIButton alloc] initWithFrame:CGRectMake(WIDTH - 85, 30, 35, 35)];
        [_btn setTitle:@"解绑" forState:UIControlStateNormal];
        _btn.titleLabel.font = font(12);
        _btn.layer.borderWidth = 1;
        _btn.layer.cornerRadius = 17.5;
        _btn.layer.borderColor = SFMWhiteColor.CGColor;
    }
    return _btn;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
